package it.patterns.behavioral.strategy;

public class Context {
	private int[] array;
	Strategy format;

	public Context(int size) {
		array = new int[size];
	}

	public void setValue(int pos, int value) {
		array[pos] = value;
	}

	public int getValue(int pos) {
		return array[pos];
	}

	public int getLength(int pos) {
		return array.length;
	}

	public void setDisplayFormat(Strategy displayStrategy) {
		format = displayStrategy;
	}

	public void display() {
		format.printData(array);
	}
}
